# 用户模型
from tortoise import fields
from tortoise.models import Model

from .role import Role

class User(Model):
    id = fields.IntField(pk=True)
    username = fields.CharField(max_length=50, unique=True)
    hashed_password = fields.CharField(max_length=128)

    role = fields.ForeignKeyField("models.Role", related_name="users")

    class Meta:
        table = "user"